package equipment_maintenance

import (
	"github.com/flipped-aurora/gin-vue-admin/server/middleware"
	"github.com/gin-gonic/gin"
)

type ServiceOrdersRouter struct {}

// InitServiceOrdersRouter 初始化 serviceOrders表 路由信息
func (s *ServiceOrdersRouter) InitServiceOrdersRouter(Router *gin.RouterGroup,PublicRouter *gin.RouterGroup) {
	serviceOrdersRouter := Router.Group("serviceOrders").Use(middleware.OperationRecord())
	serviceOrdersRouterWithoutRecord := Router.Group("serviceOrders")
	serviceOrdersRouterWithoutAuth := PublicRouter.Group("serviceOrders")
	{
		serviceOrdersRouter.POST("createServiceOrders", serviceOrdersApi.CreateServiceOrders)   // 新建serviceOrders表
		serviceOrdersRouter.DELETE("deleteServiceOrders", serviceOrdersApi.DeleteServiceOrders) // 删除serviceOrders表
		serviceOrdersRouter.DELETE("deleteServiceOrdersByIds", serviceOrdersApi.DeleteServiceOrdersByIds) // 批量删除serviceOrders表
		serviceOrdersRouter.PUT("updateServiceOrders", serviceOrdersApi.UpdateServiceOrders)    // 更新serviceOrders表
	}
	{
		serviceOrdersRouterWithoutRecord.GET("findServiceOrders", serviceOrdersApi.FindServiceOrders)        // 根据ID获取serviceOrders表
		serviceOrdersRouterWithoutRecord.GET("getServiceOrdersList", serviceOrdersApi.GetServiceOrdersList)  // 获取serviceOrders表列表
	}
	{
	    serviceOrdersRouterWithoutAuth.GET("getServiceOrdersPublic", serviceOrdersApi.GetServiceOrdersPublic)  // serviceOrders表开放接口
	}
}
